package com.youdoneed.community.forum.dao;

import java.util.List;

import com.youdoneed.community.forum.vo.updateUserInfoVo;
import org.apache.ibatis.annotations.Mapper;

import com.youdoneed.community.forum.entity.Forumlikespointrecord;

@Mapper
public interface ForumlikespointrecordMapper {
    int deleteByPrimaryKey(String likesPointRecordId);

    int insert(Forumlikespointrecord record);

    int insertSelective(Forumlikespointrecord record);

    Forumlikespointrecord selectByPrimaryKey(String likesPointRecordId);

    int updateByPrimaryKeySelective(Forumlikespointrecord record);

    int updateByPrimaryKey(Forumlikespointrecord record);

    /**
     * 用户修改个人信息时，把对应的点赞中的用户信息一起改掉
     * @param  vo
     * @return
     */
    int updateUserInfo(updateUserInfoVo vo);
    
    int countByUserIdAndForumMsgId(String userId, String forumMsgId);
    
    int cancelLikesPoint(String userId, String forumMsgId);
    
    /**
     * 根据帖子id获取点赞信息
     * @param forumMsgId
     * @return List<Forumlikespointrecord>
     * @author lid
     * @date 2017.6.22
     */
    List<Forumlikespointrecord> getLikesRecordByMsgId(String forumMsgId);

    /**
     * 根据userId和msgId获取点赞记录
     * @param userId
     * @param msgId
     * @return Forumlikespointrecord
     * @author lid
     */
    Forumlikespointrecord selectByUserIdAndMsgId(String userId, String msgId);

    /**
     * 获取首页帖子的点赞数据，只获取15条作为展示
     * @param msgId
     * @return List<Forumlikespointrecord>
     */
    List<Forumlikespointrecord> getLimitRecordsByMsgId(String msgId);

    /**
     * 根据用户获取所有点赞记录的msgId
     * @param userId
     * @return List<String>
     * @author lid
     * @date 2017.10.11
     */
    List<String> getLikePointMsgsByUserId(String userId);

    /**
     * 删除某个帖子的所有点赞记录
     *
     */
    int deleleLikesPointRecordByMsgId(String msgId);
}